Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#454 Add ProgressField #483

Merged
merged 9 commits into from
Oct 29, 2024
Merged

#454 Add ProgressField #483

merged 9 commits into from
Oct 29, 2024

Conversation

Artahs
Copy link
Contributor

@Artahs Artahs commented Oct 28, 2024

Adding ProgressField in order to generate progress bar in crudit

Copy link
Contributor

@valentin-helies valentin-helies Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

" => '
I think the field should be ProgressBarField, ProgressField is not very precise (same for the Twig file).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

" => '
Be careful of the spaces around =>

</div>
<div class="d-flex position-absolute justify-content-center align-items-center w-100">
<span
class="{% if options.progressLabelCssClass is not null %} {{ options.progressLabelCssClass }} {% else %} lh-sm fa-sm {% endif %}"> {% if options.progressLabel is not null %} {{ options.progressLabel }} {% else %} {{ percentage }} % {% endif %} </span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PSR-12 max 120 characters

</div>
{% if options.bottomLabel %}
<div>
<span>{{ value }} / {{ options.max }}</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like we can modify this text

<div class="progress w-100" role="progressbar" aria-valuenow="{{ value }}" aria-valuemin="{{ options.min }}"
aria-valuemax="{{ options.max }}">
<div
class="progress-bar {% if options.theme is not null %} {{ options.theme }} {% else %} bg-primary {% endif %} progress-bar-animated"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PSR-12 max 120 characters
You can make it shorter by making "if options.theme ... else ..."

- 'progressLabel' => Change the label displayed on the progress bar,
- 'progressLabelCssClass' => Defines the Bootstrap class for the label to customize it,
- 'min' => Integer who defines the minimum value,
- 'max' => integer who defines the maximum value,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'aimerais bien qu'on puisse avoir ça à partir d'une propriété/méthode dans l'entité.

si l'entité définit son propre maximum, on peut pas avoir une valeur fixe

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ce qui est prévu c'est que l'entité calcule le pourcentage, donc le dev peut le faire avec n'importe quelle valeur de maximum. Par défaut, c'est 100 et 0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

si c'est un pourcentage le min max ce sera toujours 0 à 100 si jamais

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

donc pas très utile d'avoir ces 2 options

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

effectivement ca n'a que peux d'interet.

@sebheitzmann sebheitzmann merged commit 6c553b2 into main Oct 29, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants